home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "DInputCode"
- Public myInput As CDXVBInput
-
- Public Sub InitDInput()
- GUIDDEFS.GUID_Initialize
-
- Set myInput = New CDXVBInput
- myInput.Create App.hInstance, main2.hWnd
- myInput.ReAcquire
- End Sub
-
- Public Sub HandleInput()
- myInput.UpdateKeyboard
-
- If Keys(DIK_ESCAPE) Then bActive = False
-
- If Keys(DIK_RETURN) Then bIns = False
-
- If Keys(DIK_RETURN) Then
- If bWinner = True Then
- ' Reset game
- bWinner = False
- bLoaded = False
- bPlayer1Won = False
- bPlayer2Won = False
- bIns = True
-
- Call BlockCode.InitBlocks
-
- Player1.x = 10
- Player1.y = 175
- Player2.x = 620
- Player2.y = 175
-
- myBall1.x = 10
- myBall1.y = 10
- myBall1.xvel = 5
- myBall1.yvel = 5
-
- myBall2.x = 619
- myBall2.y = 10
- myBall2.xvel = -5
- myBall2.yvel = 5
-
- bTP = False
- End If
- End If
-
- If Keys(DIK_R) Then
- ' Reset game
- bWinner = False
- bLoaded = False
- bPlayer1Won = False
- bPlayer2Won = False
- bIns = True
-
- Call BlockCode.InitBlocks
-
- Player1.x = 10
- Player1.y = 175
- Player2.x = 620
- Player2.y = 175
-
- myBall1.x = 10
- myBall1.y = 10
- myBall1.xvel = 5
- myBall1.yvel = 5
-
- myBall2.x = 619
- myBall2.y = 10
- myBall2.xvel = -5
- myBall2.yvel = 5
- End If
-
- If Keys(DIK_P) Then bPaused = Not bPaused
-
- If bInstructions = False Then
- If Keys(DIK_UP) Then
- Player2.SetVel -6
- ElseIf Keys(DIK_DOWN) Then
- Player2.SetVel 6
- ElseIf Not (Keys(DIK_UP) And Keys(DIK_DOWN)) Then
- Player2.SetVel 0
- End If
- If Keys(DIK_A) Then
- Player1.SetVel -6
- ElseIf Keys(DIK_Z) Then
- Player1.SetVel 6
- ElseIf Not (Keys(DIK_A) And Keys(DIK_Z)) Then
- Player1.SetVel 0
- End If
- End If
- End Sub
-